package cn.iocoder.yudao.module.shop.controller.app.tenant;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.shop.dal.dataobject.orderfeedback.ShopOrderFeedbackDO;
import cn.iocoder.yudao.module.system.controller.admin.tenantdetail.vo.TenantDetailRespVO;
import cn.iocoder.yudao.module.system.convert.tenantdetail.TenantDetailConvert;
import cn.iocoder.yudao.module.system.dal.dataobject.tenantdetail.TenantDetailDO;
import cn.iocoder.yudao.module.system.service.tenantdetail.TenantDetailService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "用户 App - 评价反馈")
@RestController
@RequestMapping("/shop/tenant")
@RequiredArgsConstructor
@Validated
@Slf4j
public class AppTenantController {

    @Resource
    private TenantDetailService tenantDetailService;

    @GetMapping("/id")
    @Parameter(name = "id", description = "编号", required = true, example = "1")
    @Operation(summary = "获取店铺信息")
    public CommonResult<TenantDetailRespVO> getByOrderId(@RequestParam("id") Long id){
        TenantDetailDO tenantDetailDO = tenantDetailService.getTenantDetailByTenantId(id);
        TenantDetailRespVO respVO = TenantDetailConvert.INSTANCE.convert(tenantDetailDO);
        return success(respVO);
    }
}
